<!DOCTYPE html>
<html>
<head>
<title>标题</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1>WS</h1>

<script>
    alert(1);
    
    console.log("开始了");

    var wsUrl="ws://122.114.185.73:8811";

    // var webscoket=new WebSocket(wsUrl);

    var webscoket=new WebSocket(wsUrl);
    

    webscoket.onopen=function(evt){
        console.log("打开成功！");
    }

    webscoket.onmessage=function(etc){
        consloe.log("on-message"+evt.data);
    }
    //close
    webscoket.onclose=function(evt){
        console.log("close");
    }

    //error
    	webscoket.onerror=function(ext,e){
    	console.log(ext);
    	console.log(e);
    	
    }


    

</script>
</body>
</html>